package org.example.utils;

import io.jsonwebtoken.Claims;
import org.example.mapper.UserPermissionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Component
public class CheckUtils {
    public static final Integer CHANGE_CLASS_ACCOUNT_PERMISSION = 1;
    @Autowired
    private static UserPermissionMapper userPermissionMapper;

    public static boolean ImageFileInvalid(MultipartFile image) {
        return image == null || image.isEmpty();
    }
    public static boolean checkPermissionInUserTable(int id, Claims claims) {
        return Integer.parseInt(claims.get("id").toString()) == id;
    }

}
